import request from "@/apis/request";

export const findProcessSetting = async (form, currentPage,pageSize) =>{
    return await request.get('/api/processSettings/find',{
        params:{
            processCode:form.processCode,
            processName:form.processName,
            isEnabled:form.isEnabled,
            currentPage:currentPage,
            pageSize:pageSize
        }
    })
}
export const findProcessSettingById = async (id) =>{
    return await request.get('/api/processSettings/findById',{
        params:{
            id:id
        }
    })
}
export const addProcessSetting = async (form) =>{
    return await request.post('/api/processSettings/insert',form)
}
export const updateProcessSetting = async (form) =>{
    return await request.put('/api/processSettings/update',form)
}
export const deleteProcessSetting = async (id) =>{
    console.log("id",id)
    return await request.delete('/api/processSettings/delete',{data:id})
}

export const findDetails = async (processCode) =>{
    return await request.get('/api/processSettings/findDetails',{
        params:{
            processCode:processCode
        }
    })
}
export const updateDetails = async (form) =>{
    return await request.put('/api/processSettings/updateSteps',form)
}
export const addDetails = async (form) =>{
    return await request.post('/api/processSettings/addSteps',form)
}
//删除工序详情
export const deleteDetails = async (id) =>{
    return await request.delete('/api/processSettings/deleteStep',{data:id})
}